package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.service.DataProviderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumerController {

    @Autowired
    private DataProviderFeignClient dataProviderFeignClient;

    @Value("${server.port}")
    private int serverPort;

    @GetMapping("/consumer/cart/get/data")
    public String getData() {
        return dataProviderFeignClient.getData() + " cart port:" + serverPort;
    }
}
